#ifndef WIDGET_H
#define WIDGET_H

#include <QChartView>
#include <QScatterSeries>
#include <QSplineSeries>
#include <QTimer>
#include <QWidget>

namespace Ui {
class Widget;
}

class Widget : public QWidget {
  Q_OBJECT

public:
  explicit Widget(QWidget *parent = 0);
  ~Widget();

private:
  Ui::Widget *ui;
  QTimer timer;
  QtCharts::QChartView *chartView;
  QtCharts::QChart *chart;
  QtCharts::QScatterSeries *scatterSeries;
  QtCharts::QSplineSeries   *splineseries;

  int maxSize;
  int maxX;
  int maxY;
  int timerId;
  QList<int> data;
private slots:
  void timeout_readData();
};

#endif // WIDGET_H
